package guda.house.biz.form;

import guda.house.dal.dataobject.RoleDO;

import javax.validation.constraints.NotNull;

/**
 * Created by well on 15/11/8.
 */
public class RoleEditForm extends RoleForm{

    @NotNull(message = "不能为空")
    private Long roleId;

    public void initForm(RoleDO roleDO){
        if(roleDO == null){
            return ;
        }
        setRoleId(roleDO.getRoleId());
        setRoleName(roleDO.getRoleName());
        setRoleDesc(roleDO.getRoleDesc());
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }


    public RoleDO toDO(){
        RoleDO roleDO = super.toDO();
        roleDO.setRoleId(roleId);
        return roleDO;
    }
}
